package com.isoft.airportsystem.mapper.Flight;

import com.isoft.airportsystem.entity.flight.Airport;
import com.isoft.airportsystem.entity.flight.BaggageInfo;
import com.isoft.airportsystem.entity.flight.FlightInfo;
import com.isoft.airportsystem.vo.FlightQueryVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface FlightMapper {
    // 基础航班查询
    List<FlightInfo> selectFlightList(FlightQueryVO flightQueryVO);

    // 根据ID查询航班详情
    FlightInfo selectFlightById(String flightId);

    // 条件统计航班数量
    int countFlights(Map<String, Object> params);

    // 分页查询航班
    List<FlightInfo> selectFlightPage(@Param("params") Map<String, Object> params);

    // 查询行李信息
    List<BaggageInfo> selectBaggageByFlightId(String flightId);

    // 查询机场信息
    List<Airport> selectAirportList(Airport airport);

    // 航班状态统计
    List<Map<String, Object>> selectFlightStatusStats();

    // 航班延误统计
    List<Map<String, Object>> selectDelayStats();

    // 获取最近航班信息
    List<FlightInfo> selectRecentFlights(@Param("limit") int limit);

    int deleteFlight(@Param("flightId") String flightId);

    int insertFlight(FlightInfo flightInfo);
    int updateFlight(FlightInfo flightInfo);
}